# coding: utf-8
import os
import sys

from PySide6.QtCore import Qt
from PySide6.QtGui import QColor
from PySide6.QtWidgets import QApplication
from qfluentwidgets import setThemeColor
from common import cfg
from view.mian_interface import MainInterface

if cfg.get(cfg.dpiScale) != "Auto":
    os.environ["QT_ENABLE_HIGHDPI_SCALING"] = "0"
    os.environ["QT_SCALE_FACTOR"] = str(cfg.get(cfg.dpiScale))

# create application
app = QApplication(sys.argv)
app.setAttribute(Qt.ApplicationAttribute.AA_DontCreateNativeWidgetSiblings)
# create main window
demo = MainInterface()
setThemeColor(QColor(139, 150, 217, 1), save=True)
demo.show()

app.exec()
